<?php
include "connect/connect_dsccmis.php";
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
//XML Header
header("content-type:text/xml");

//$userid=$_POST["userid"];
$email=$_POST["email"];
$pwd=$_POST["pwd"];
$pid=$_POST["pid"];
$fullname=$_POST["fullname"];
$user_position=$_POST["user_position"];
$private_phone=$_POST["private_phone"];
$under_org=$_POST["under_org"];
$org_address=$_POST["org_address"];
$usage_objective=$_POST["usage_objective"];
$user_type=$_POST["user_type"];
$ref_doc=$_POST["ref_doc"];
$active=$_POST["active"];
$regis_dte=$_POST["regis_dte"];
$cmm=$_POST["cmm"];
$ampid=$_POST["ampid"];
$prvid=$_POST["prvid"];

//mysql_query("set names utf8");
$sql="select email from user where email='$email'";
$result=mysql_query($sql);
$num_row=mysql_num_rows($result);
if($num_row>0){
	$message="0:Duplicate Email";
}else{
	//mysql_query("set names utf8");
	$sql="select pid from user where pid='$pid'";
	$result=mysql_query($sql);
	$num_row=mysql_num_rows($result);
	if($num_row>0){
		$message="0:Duplicate PID";
	}else{
		$sql="insert into user(email, pwd, pid, fullname, user_position, private_phone, under_org, org_address, usage_objective, user_type, ref_doc, active, regis_dte, cmm,prvid,ampid) values('$email','$pwd','$pid','$fullname','$user_position','$private_phone','$under_org','$org_address','$usage_objective','$user_type','$ref_doc',$active,'$regis_dte','$cmm','$prvid','$ampid');";
		$result=mysql_query($sql);
		//$message="1:Success:".$sql;
	}
	
}
if($result)
	echo "1:Success";
else
	echo "0:Fail";
/*$sql1="insert into user(email, pwd, pid, fullnme, user_position, private_phone, under_org, org_address, usage_objective, user_type, ref_doc, active, regis_dte, cmm) values('$email','$pwd','$pid','$fullnme','$user_position','$private_phone','$under_org','$org_address','$usage_objective',$user_type,'$ref_doc','$active','$regis_dte','$cmm)";
mysql_query("set names tis620");
$result1=mysql_db_query($dbname,$sql1);
if ($result1) {	*/
?>
